<template>
  <ButtonGroup title="居中设置" :status="status[currentStatus]">
    <el-button-group>
      <el-button
        @click="changePosition(0)"
        :class="{
          select: currentStatus === 0,
        }"
      >
        <font-awesome-icon icon="align-left"
      /></el-button>
      <el-button
        @click="changePosition(1)"
        :class="{
          select: currentStatus === 1,
        }"
        ><font-awesome-icon icon="align-center"
      /></el-button>
    </el-button-group>
  </ButtonGroup>
</template>

<script setup>
import { inject } from 'vue';
import ButtonGroup from './ButtonGroup.vue';
const props = defineProps({
  status: Array,
  configKey: String,
  currentStatus: Number,
});

const updateStatus = inject('updateStatus', () => {});

const changePosition = (pos) => {
  if (updateStatus) {
    updateStatus(props.configKey, pos);
  }
};
</script>

<style scoped></style>
